package com.oliver.oliveraiagent.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName users
 */
@TableName(value ="user")
@Data
public class User {
    /**
     * 用户唯一标识
     */
    @TableId(type = IdType.ASSIGN_ID)
    private Long userId;

    /**
     * 登录用户名
     */
    private String userName;

    /**
     * 登录账号
     */
    private String account;

    /**
     * BCrypt加密后的密码
     */
    private String password;

    /**
     * 用户头像
     */
    private String avatarImg;

    /**
     * 邮箱地址
     */
    private String email;

    /**
     * 账户状态(1=激活,0=禁用)
     */
    private Integer isActive;

    /**
     * 注册时间
     */
    private Date createdAt;

    /**
     * 最后登录时间
     */
    private Date lastLogin;

    /**
     * 是否删除 0-未删除 1-已删除
     */
    private Integer isDelete;

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", userId=").append(userId);
        sb.append(", username=").append(userName);
        sb.append(", passwordHash=").append(password);
        sb.append(", avatarImg=").append(avatarImg);
        sb.append(", email=").append(email);
        sb.append(", isActive=").append(isActive);
        sb.append(", createdAt=").append(createdAt);
        sb.append(", lastLogin=").append(lastLogin);
        sb.append(", isDelete=").append(isDelete);
        sb.append("]");
        return sb.toString();
    }
}